<?php
/**
 * Created by PhpStorm.
 * User: nefa
 * Date: 2018/3/1
 * Time: 下午3:03
 */

function login_default(){
    logOut();
    login_page();
}

function login_page(){
    _output_template(0,'login');
}

function _zhengxie_outputLogin(){
    //修改密码dialog
    $str = '<div class="resetpass_dialog" style="display: none;width:100%;height:100%; min-width: 1440px;min-height: 750px;background-color: #1115;position: absolute;z-index: 9999;">
                <div style="position: absolute;top: 30%;left: 50%; transform: translateX(-50%); width: 686px;height: 480px;">
                    <div style="position: absolute;right: 0px;"><a><div onclick="dialog_hide()" class="finish" style="width: 50px;height: 50px"></div></a></div>
                    <div class="dialog_title" style="background-color: #429de3;border-top-left-radius: 8px;border-top-right-radius: 8px;height: 214px;width: 100%">
                        <div class="title_div_1" style="width: 100%;height: 50%;color: white;text-align: center;">
                            <div style="font-size: 18px;padding-top: 30px">找回密码</div>
                        </div>
                        <div class="title_div_2" style="width: 100%;height: 50%;color: white;">
                            <div style="width: 80%;height: 100%;margin: 0px auto">
                                <div style="font-size: 18px;width: 50%;height: 100%;text-align: center;display: inline-block">
                                    填写手机号
                                    <div class="phone_underline" style="width: 100%;height: 4px;margin-top: 18px;float: left;background-color: white"></div>
                                </div>
                                <div style="font-size: 18px;width: 50%;height: 100%;text-align: center;float: right;display: inline-block">
                                    重置密码
                                    <div class="reset_underline" style="width: 100%;height: 2px;margin-top: 19px;background-color: #5dabe8"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="dialog_bottom" style="background-color: white;height: 264px;width: 100%;border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;">
                        <div class="dialog_middle" style="width: 390px;height: 190px;margin: 0px auto;">
                            <div style="width: 100%;position: relative;top: 50%;transform: translateY(-50%)">
                                <span class="password_hint" style="font-size: 16px;color: #333;height: 50px;line-height: 50px;text-align: center;position: absolute;left: -60px">新密码:</span>
                                <span class="password_hint_two" style="font-size: 16px;color: #333;height: 50px;line-height: 50px;text-align: center;position: absolute;left: -76px;bottom: 4px">确认密码:</span>
                                <input class="input_1" type="text" style="text-indent: 12px;border-radius: 4px;font-size: 16px;width: 384px;height: 50px;border: 1px solid #f5faff;background-color: #fafdff;" placeholder="请输入手机号">
                                <input class="input_2" type="text" style="text-indent: 12px;border-radius: 4px;font-size: 16px;width: 284px;height: 50px;border: 1px solid #f5faff;margin-top: 20px;background-color: #fafdff" placeholder="请输入验证码">
                                <script>
                                    $(".password_hint").hide();
                                    $(".password_hint_two").hide();
                                </script>
                                <input class="get_verificationCode" type="button" onclick="getVerificationCode(this)" style="background-color: #4e99ff;width: 100px;height: 55px;border-radius: 4px;position: absolute;right: 0px;bottom: 0px;color: white;font-size: 15px" value="验证码">
                            </div>
                            <span class="error_message" style="position: relative;bottom: -37px;color: red;font-size: 14px;padding-left: 12px"></span>
                        </div>
                        <a class="dialog_next" >
                        <script>
                            $(".error_message").hide();
                        </script>
                        <div onclick="checkVerificationCode()" style="border-bottom-left-radius: 8px;border-bottom-right-radius: 8px;font-size: 18px;color: #469ee3;height: 74px;width: 100%;line-height: 74px;text-align: center;border-top: 1px solid #d2ebff">下一步</div>
                        </a>
                    </div>
                </div>
            </div>
            <script>
                $(".resetpass_dialog").hide();
            </script>';


    $str .= '<div class="main_login" style="width:100%;height:100%; min-width: 1440px;min-height: 1150px">
                <div style=" width: 60%;height: 120px;position: relative; left: 50%;top: 12%; transform: translateX(-50%)">
                    <div style="width: 100%;height: 50%">
                        <div class="login_logo" style="position: absolute;left: -25%;top: -25%; "></div>
                        <div style="width: 15%;height: 3px;background-color: white; float: left;position:relative;top: 50%;transform: translateY(-50%);"></div>
                        <div style="font-family: fangzheng;color: white;font-size: 60px;width:70%;text-align: center;display: inline-block;position:relative;top: 50%;transform: translateY(-50%);">政协提案管理信息系统</div>
                        <div style="width: 15%;height: 3px;background-color: white; float: right;position:relative;top: 50%;transform: translateY(-50%);"></div>
                    </div>
                    <div style="width: 100%;height: 50%">
                        <div style="font-family: fangzheng;font-size: 40px;margin-top: 28px;color: white; text-align: center;">西安市碑林区</div>
                    </div>
                </div>
                
                
                <div class="login_window" style="position: relative;top: 18%;left: 50%; transform: translateX(-50%); width: 557px;height: 472px;">
                    <div style="display: inline-block;width: 70%;height: 50px;position: relative;top: 80px;left: 50%;transform: translateX(-50%);background-color: white">
                        <div class="login_username_img" style="width: 50px;height: 50px;position: absolute;left: 0"></div>
                        <input class="login_username_text" type="text" style="font-size: 16px;padding-left: 13%;width: 87%;height: 50px;">
                    </div>
                    
                    <div style="display: inline-block;width: 70%;height: 50px;position: relative;top: 130px;left: 50%;transform: translateX(-50%);background-color: white">
                        <div class="login_password_img" style="width: 50px;height: 50px;position: absolute;left: 0"></div>
                        <input class="login_password_text" type="password" style="font-size: 16px;padding-left: 13%;width: 87%;height: 50px;">
                    </div>
                    
                    <div style="display: inline-block;width: 70%;position: relative;top: 140px;left: 50%;transform: translateX(-50%);">
                        <a ><div onclick="dialog_show()" style="color:#599edd;float: right">忘记密码?</div></a>
                        <div class="login_errorMessage" style="color: red;float: left;text-indent: 15px"></div>
                        <script>$(".login_errorMessage").hide();</script>
                        <div style="clear: both"></div>
                    </div>
                    
                    <div style="display: inline-block; border-radius: 5px;width: 390px;height: 50px;line-height:50px;text-align:center;position: relative;top: 190px;left: 50%;transform: translateX(-50%);">
                        <a><div class="login_button" onclick="login()"  style="background-color: #599edd;color: white;font-size: 17px;width: 100%;height: 100%;">登录</div></a>
                    </div>
                </div>
                
                <div style="font-size: 16px;color: #8accff;position: relative; left: 50%;bottom: -46%; transform: translateX(-50%);text-align: center">
                    Copyright @ 2017 chenghun.gov.cn All right reserved.西安领军教育职能科技有限公司 版权所有
                </div>
            </div>';
    return $str;

    /**
     * session自动登录逻辑
     * 1.判断有没有session
     * 2.如果有,拿着sessionid去数据库表里查看一下userid是谁,也就是谁是登录状态.  (假如sessionID为1,在表里查看这个sessionID关联的这条数据中的userid,如果有,把这个userid请空掉,如果userid为0,则查出当前sessionId中保存的用户信息并保存,然后判定用户已登录)
     * 3.
     */
}